/************************************
 * Package: RGcpp					*
 * Authors: Rui Eduardo Gouveia Gil	*
 * Date: 2010						*
 ************************************/
#ifndef __RGCPP_CIPHER_H__
#define __RGCPP_CIPHER_H__

#include <iostream>
#include <openssl/evp.h>

#include "rgcpp/exceptions/RuntimeException.h"

namespace rgcpp
{

class Cipher
{
	private:
		FILE *random;

	public:
		Cipher();
		~Cipher();

		bool generateKey(char *key, unsigned int keylen);
		static int encrypt(char *key, unsigned int keylen, char *in, unsigned int inlen, char *out, unsigned int outlen);
		static int decrypt(char *key, unsigned int keylen, char *in, unsigned int inlen, char *out, unsigned int outlen);
};

}

#endif
